﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrainingWorkshop.DAL_EF
{
    class ModelConverter
    {
        /// <summary>
        /// Convert EF_Teacher list  in to Model_Teacher List
        /// </summary>
        /// <param name="inputList">EF Teacher List</param>
        /// <returns>Model Teacher List</returns>
        public  static List<Model.Teacher> ToTeacher(List<Teacher> inputList){

            List<Model.Teacher> teacherList = new List<Model.Teacher>();
            foreach (Teacher t in inputList)
            {
                Model.Teacher teacher = new Model.Teacher();
                teacher.TeacherId = t.TeacherId;
                teacher.TeacherName = t.TeacherName;
                teacher.TeacherGender = t.TeacherGender;
                teacher.DepartmentId = t.DepartmentId;
                teacherList.Add(teacher);
            }
            return teacherList;

        }

        /// <summary>
        /// Convert EF Level list into Model Level list
        /// </summary>
        /// <param name="inputList">EF Level List</param>
        /// <returns>Model List</returns>
        public static List<Model.Level> ToLevel(List<Level> inputList)
        {
            List<Model.Level> levelList = new List<Model.Level>();
            foreach (Level t in inputList)
            {
                Model.Level level = new Model.Level();
                level.LevelId = t.LevelId;
                level.LevelName = t.LevelName;
                levelList.Add(level);
            }
            return levelList;
        }

        
    }
}
